package com.ty.day2;

import java.util.Scanner;

/**
 * Created by IntelliJ IDEA.
 *
 * @Author : txy
 * @Create 2023/10/27 10:43
 */
public class Two {
    public static void main(String[] args) {
//        for (int i = 1; i < 1000; i++) {
//            for (int j = 1; j <= i / 2 + 1; j++) {
//                if (j * j == i) {
//                    System.out.println(j + "*" + j + "=" + i);
//                    break;
//                }
//            }
//        }
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个整数");
        int x = sc.nextInt();
        double result = Math.sqrt(x);
        System.out.printf("%d的平方根为：%.2f", x, result);
        if (x % result == 0) {
            System.out.println(", " + x + "是完全平方数");
        } else {
            System.out.println(", " + x + "不是完全平方数");
        }
    }
}
